package net.lab1024.sa.base.module.support.traffic.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import lombok.Data;

/**
 * MQTT配置
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "mqtt")
public class MqttConfig {

    /**
     * MQTT Broker地址
     */
    private String brokerUrl = "tcp://101.42.223.194:1883";

    /**
     * 用户名
     */
    private String username = "traffic_control";

    /**
     * 密码
     */
    private String password = "your_secure_password";

    /**
     * 客户端ID前缀
     */
    private String clientIdPrefix = "ctrl_center_";

    /**
     * 主题前缀
     */
    private String topicPrefix = "traffic_control/intersection/1201100";

    /**
     * 连接超时时间（秒）
     */
    private int connectionTimeout = 30;

    /**
     * 保持连接间隔（秒）
     */
    private int keepAliveInterval = 60;

    /**
     * 是否自动重连
     */
    private boolean automaticReconnect = true;

    /**
     * 是否清除会话
     */
    private boolean cleanSession = true;
}

